package com.itheima.类加载器;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @Author 王加鑫
 * @Date 2021/5/26 10:15
 * @Version 1.0
 */
public class ClassLoaderDemo01 {

    public static void main(String[] args) throws IOException {
        //获取系统类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        //利用加载器去加载一个指定的文件,文件默认再src里面
        InputStream is = systemClassLoader.getResourceAsStream("prop.properties");
        Properties properties = new Properties();
        properties.load(is);
        System.out.println(properties);
        is.close();

    }
}
